const { assert } = require('koa/lib/context')
const Article = require('@root/models/article.model')

const User = require('@root/models/user.model')

exports.createArticle = async(ctx,next)=>{
    for(let property of ['title','description','body']){
        assert(ctx.request.body.article[property],422,`${property} 不能为空`)
    }
    await next();
}

exports.updateArticle = async(ctx,next)=>{
    for(let property of ['title','description','body']){
        assert(ctx.request.body.article[property],422,`${property} 不能为空`)
    }
    await next();
}
